package com.cy.pj.common.pojo;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class JsonResult {
    /*状态码*/
    private Integer state=1;
    /*状态码信息*/
    private String message="ok";
    /*封装正确的查询结果*/
    private Object data;

    public JsonResult(){

    }

    public JsonResult(String message) {
        this.message = message;
    }

    public JsonResult(Integer state, String message) {
        this(message);
        this.state = state;
//        this.message = message;
    }

    public JsonResult(Object data) {
        this.data = data;
    }

    public JsonResult(Throwable exception){
        this(0,exception.getMessage());
        /*this.state=0;
        this.message=exception.getMessage();*/
    }
}
